<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:myta="http://java.sun.com/jsf/composite/myta">

	<ui:composition template="/templates/form.xhtml">
			<ui:define name="title">SIA Online</ui:define>
			<ui:define name="header">Analisa Nilai Siswa</ui:define>
			<ui:define name="body">
				<h:form id="data" onkeypress="if(event.keyCode==13)return false;">
					<div class="panel panel-primary">
						<div class="panel-heading">Filter Analisa Nilai Siswa</div>
						<div class="panel-body">
							<div class="form-horizontal">
								<div class="form-group">
									<label for="nis" class="col-sm-2 control-label">Nama Siswa</label>
									<div class="col-sm-10">
										<h:selectOneMenu id="nis" binding="#{analisa.txtnis}" styleClass="form-control">
											<f:selectItems value="#{analisa.listNis}"/>
										</h:selectOneMenu>
									</div>
								</div>
								<div class="pull-right">
									<h:commandButton value="Proses Laporan" action="#{analisa.proses()}" styleClass="btn btn-success">
										<f:ajax execute="@form" render="datatable"/>
									</h:commandButton>
								</div>
							</div>
						</div>
					</div>
					<div class="panel panel-primary">
						<div class="panel-heading">Data Analisa Siswa</div>
						<div class="panel-body">
							<div class="pull-right">
								<h:commandButton value="Print Cart Analisa" action="#{analisa.pdf()}" styleClass="btn btn-warning"/>
							</div>
							<br/><br/><br/><br/>
							<h:dataTable id="datatable" value="#{analisa.datatable.dataRows}" var="var" styleClass="table table-bordered table-striped">
								<h:column>
									<f:facet name="header">Thn. Ajaran</f:facet>
									#{var[0]}
								</h:column>
								<h:column>
									<f:facet name="header">Kelas</f:facet>
									#{var[1]}
								</h:column>
								<h:column>
									<f:facet name="header">Nama Siswa</f:facet>
									#{var[3]}
								</h:column>
								<h:column>
									<f:facet name="header">Mata Pelajaran</f:facet>
									#{var[4]}
								</h:column>
								<h:column>
									<f:facet name="header">Nilai Rapot</f:facet>
									#{var[5]}
								</h:column>
							</h:dataTable>
						</div>
					</div>
				</h:form>
			</ui:define>
	</ui:composition>
</html>